package com.duke.business.service.sb01.script2platform.app;

import java.net.URL;
import java.net.URLClassLoader;
/**
 * @author gjy
 * @create 2025-08-14 16:31
 */
public class ClassLoaderUtils {
    public static ClassLoader createScriptClassLoader(String scriptDir) throws Exception {
        URL scriptUrl = new URL("file:" + scriptDir + "/");
        return new URLClassLoader(new URL[]{scriptUrl}, null); // null = 无父加载器，完全隔离
    }
}
